package park;

import java.awt.peer.ScrollPanePeer;
import java.util.Scanner;

public class J09Retangle {

	// 1.변수선언 및 초기화
	// 2.계산 및 연산
	// 3.결과 출력

	public static void main(String[] args) {

		double width[] = new double [2];
		double height[] = new double [2];
		double getArea[] = new double [2];
		double getPerimeter[] = new double [2];
		double area[] = new double [2];
		double perimeter[] = new double [2];
		double inputRetagle[] = new double [2];
		String color[] = new String [2];
		
		

		 //면적 , 둘레 계산
		 
		inputRetagle(width,height,color);
		getArea(area,width,height);
		getPerimeter(perimeter,width,height);
		
		
		//결과출력
		
		System.out.println(width[1]);
		System.out.println(height[1]);
		System.out.println(area[1]);
		System.out.println(perimeter[1]);
		System.out.println(color[1]);
		
	}	
	
		//사각형 가로,세로,색상 입력
	
		public static void inputRetagle(
				double width[] ,double height[], String color[]){
			
			Scanner sc = new Scanner(System.in);
			System.out.println("가로는?");
			width[1] = sc.nextDouble();
			System.out.println("세로는?");
			height[1] = sc.nextDouble();    
		    System.out.println("색상은?");
			color[1] = sc.next();		
			
			sc.close();		
			
		}
	
		

		//사각형 면적계산
		
		public static void getArea(
				
			double area[], double width[], double height[]){
			
			area[1] = width[1] * height[1];
		}
		
		// 사각형 둘레 계산
		
		public static void getPerimeter(
				
			double perimeter[], double width[], double height[]){
			
			perimeter[1] = (width[1] + height[1])*2;
		}
	
		/*
		 * 
		 * 
		 * 
		 * 
		 * 
		 * 	public static void main(String[] args) {

			double width[] = new double[2];
			double height[] = new double[2];
			double getArea[] = new double[2];
			double getPerimeter[] = new double[2];
			String color[] = new String[2];
			
			
			
			 red(width,height,color);
			 orange(width,height,color);
		 
		
		 * 
		 * 
		 public static void red(
			double width[],double height[],String color[]){
				
			double getArea[] = new double[2];
			double getPerimeter[] = new double[2];
			
			getArea[1] = width[1] * height[1];
			getPerimeter[1] = (width[1] + height[1]) * 2;
	
			System.out.println(getArea[1]);
			System.out.println(getPerimeter[1]);
			System.out.println(color[1]);
			System.out.println();
			
			}
		
		
		public static void orange(
			double width[],double height[],String color[]){
			double getArea[] = new double[2]; 
			double getPerimeter[] = new double[2];
			
			getArea[1] = width[1] * height[1];
			getPerimeter[1] = (width[1] + height[1]) * 2;
	
			System.out.println(getArea[1]);
			System.out.println(getPerimeter[1]);
			System.out.println(color[1]);

		}*/
		
		
		
}


